package cn.wokoba.dao.mapper;


import cn.wokoba.dao.pojo.StrategyAward;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface StrategyAwardMapper extends BaseMapper<StrategyAward> {
    @Update("""
            update strategy_award
            set award_count_surplus = award_count_surplus - 1
            where strategy_id = #{strategyId} and award_id = #{awardId} and award_count_surplus > 0""")
    void updateStrategyAwardStock(StrategyAward strategyAward);
}
